var redis = require('redis');
// var client = redis.createClient(config.redis.port, config.redis.host);
var client = redis.createClient(); //localhost:6379

client.on('connect', main);



var redisLua2 = require('redis-lua2');

function main() {
    // create two point
    var pA = {
        lng: 116.405285,
        lat: 39.904989
    };

    var pB = {
        lng: 116.458605,
        lat: 39.90511
    };

    // save to redis
    redis.hmset('pA', 'lng', pA.lng, 'lat', pA.lat);
    redis.hmset('pB', 'lng', pB.lng, 'lat', pB.lat);

    // calculate distance


    console.log('done');
}